package com.lh.qt.domain;

import cn.hutool.http.HttpUtil;
import com.lh.qt.entity.Info;

import java.lang.reflect.Field;

/**
 * Author :李雪 2023/11/28
 * Department : 研发部
 */
public class All {
    public static void main(String[] args) throws IllegalAccessException {
        //https://qt.gtimg.cn/q=sh600000 获取信息
        //"https://data.gtimg.cn/flashdata/hushen/latest/daily/sz000001.js?maxage=43&visitDstTime=1"
        //"https://data.gtimg.cn/flashdata/hushen/daily/17/sz000001.js?visitDstTime=1"
        //https://proxy.finance.qq.com/ifzqgtimg/appstock/app/newfqkline/get?_var=kline_dayqfq&param=sz000001,day,2023-01-01,2023-12-31,320,qfq&r=0.5892023205629469
       String result =  HttpUtil.get("https://web.ifzq.gtimg.cn/other/klineweb/klineWeb/weekTrends?code=sh600001&type=qfq&_var=trend_qfq");

        String[] info = result.split("\\\\n\\\\")[1].trim().split(" ");
//        String result =  HttpUtil.get("https://qt.gtimg.cn/q=sh600000");
//        Info info1 = new Info();
//        String[] info = result.split("=")[1].split("~");
//        Field[] fileds = Info.class.getDeclaredFields();
//        for (int i = 0; i < fileds.length; i++) {
//            Field field = fileds[i];
//            field.setAccessible(true);
//            field.set(info1,info[i+1]);
//        }
//        System.out.println(result);
    }
}
